﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Bussiness.Service;
using Ext.Net;

namespace Bussiness.View.BackEnd.User_Control
{
    public partial class TK_SanPham : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            LoaiSP_Store.DataSource = new Catelogy_Service().getAllCatelogiesProductChild();
            LoaiSP_Store.DataBind();
        }

        protected void search_SanPham(object sender, DirectEventArgs e)
        {
            Product pr = new Product();
            pr.Code = tk2_maSP.Text;
            pr.Name = tk2_tenHang.Text;
            if (tk2_loaiSP.SelectedItem.Value != null)
            pr.IdCategory = int.Parse(tk2_loaiSP.SelectedItem.Value);

            tk_SP_Store.DataSource =  new Product_Service().search_Product(pr);
            tk_SP_Store.DataBind();
        }
    }
}